/*   1:    */ package org.jetbrains.jps.model.module.impl;
/*   2:    */ 
/*   3:    */

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jps.model.JpsElement;
import org.jetbrains.jps.model.JpsElementType;
import org.jetbrains.jps.model.ex.JpsCompositeElementBase;
import org.jetbrains.jps.model.module.JpsModuleSourceRootType;
import org.jetbrains.jps.model.module.JpsTypedModuleSourceRoot;
import org.jetbrains.jps.util.JpsPathUtil;

import java.io.File;
import java.util.Set;

/*   4:    */
/*   5:    */
/*   6:    */
/*   7:    */
/*   8:    */
/*   9:    */
/*  10:    */
/*  11:    */
/*  12:    */
/*  13:    */
/*  14:    */ 
/*  15:    */ public class JpsModuleSourceRootImpl<P extends JpsElement>
/*  16:    */   extends JpsCompositeElementBase<JpsModuleSourceRootImpl<P>>
/*  17:    */   implements JpsTypedModuleSourceRoot<P>
/*  18:    */ {
/*  19:    */   private final JpsModuleSourceRootType<P> a;
/*  20:    */   private final String b;
/*  21:    */   
/*  22:    */   public JpsModuleSourceRootImpl(String paramString, JpsModuleSourceRootType<P> paramJpsModuleSourceRootType, P paramP)
/*  23:    */   {
/*  24: 39 */     this.a = paramJpsModuleSourceRootType;
/*  25: 40 */     this.myContainer.setChild(paramJpsModuleSourceRootType.getPropertiesRole(), paramP);
/*  26: 41 */     this.b = paramString;
/*  27:    */   }
/*  28:    */   
/*  29:    */   private JpsModuleSourceRootImpl(JpsModuleSourceRootImpl<P> paramJpsModuleSourceRootImpl)
/*  30:    */   {
/*  31: 45 */     super(paramJpsModuleSourceRootImpl);
/*  32: 46 */     this.a = paramJpsModuleSourceRootImpl.a;
/*  33: 47 */     this.b = paramJpsModuleSourceRootImpl.b;
/*  34:    */   }
/*  35:    */   
/*  36:    */   public <P extends JpsElement> P getProperties(@NotNull JpsModuleSourceRootType<P> paramJpsModuleSourceRootType)
/*  37:    */   {
/*  38: 52 */     if (paramJpsModuleSourceRootType == null) {
/*  39: 52 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/module/impl/JpsModuleSourceRootImpl", "getProperties" }));
/*  40:    */     }
/*  41: 52 */     if (this.a.equals(paramJpsModuleSourceRootType)) {
/*  42: 54 */       return this.myContainer.getChild(this.a.getPropertiesRole());
/*  43:    */     }
/*  44: 56 */     return null;
/*  45:    */   }
/*  46:    */   
/*  47:    */   @Nullable
/*  48:    */   public <P extends JpsElement> P getProperties(@NotNull Set<? extends JpsModuleSourceRootType<P>> paramSet)
/*  49:    */   {
/*  50: 62 */     if (paramSet == null) {
/*  51: 62 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/module/impl/JpsModuleSourceRootImpl", "getProperties" }));
/*  52:    */     }
/*  53: 62 */     if (paramSet.contains(this.a)) {
/*  54: 63 */       return getProperties();
/*  55:    */     }
/*  56: 65 */     return null;
/*  57:    */   }
/*  58:    */   
/*  59:    */   @Nullable
/*  60:    */   public <P extends JpsElement> JpsTypedModuleSourceRoot<P> asTyped(@NotNull JpsModuleSourceRootType<P> paramJpsModuleSourceRootType)
/*  61:    */   {
/*  62: 72 */     if (paramJpsModuleSourceRootType == null) {
/*  63: 72 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/module/impl/JpsModuleSourceRootImpl", "asTyped" }));
/*  64:    */     }
/*  65: 72 */     return this.a.equals(paramJpsModuleSourceRootType) ? this : null;
/*  66:    */   }
/*  67:    */   
/*  68:    */   @NotNull
/*  69:    */   public JpsTypedModuleSourceRoot<?> asTyped()
/*  70:    */   {
/*  71: 78 */     if (this == null) {
/*  72: 78 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/module/impl/JpsModuleSourceRootImpl", "asTyped" }));
/*  73:    */     }
/*  74: 78 */     return this;
/*  75:    */   }
/*  76:    */   
/*  77:    */   public JpsElementType<?> getType()
/*  78:    */   {
/*  79: 83 */     return this.a;
/*  80:    */   }
/*  81:    */   
/*  82:    */   @NotNull
/*  83:    */   public P getProperties()
/*  84:    */   {
/*  85: 89 */     JpsElement tmp16_13 = this.myContainer.getChild(this.a.getPropertiesRole());
/*  86: 89 */     if (tmp16_13 == null) {
/*  87: 89 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/module/impl/JpsModuleSourceRootImpl", "getProperties" }));
/*  88:    */     }
/*  89: 89 */     return tmp16_13;
/*  90:    */   }
/*  91:    */   
/*  92:    */   @NotNull
/*  93:    */   public JpsModuleSourceRootType<P> getRootType()
/*  94:    */   {
/*  95: 95 */     JpsModuleSourceRootType tmp4_1 = this.a;
/*  96: 95 */     if (tmp4_1 == null) {
/*  97: 95 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/module/impl/JpsModuleSourceRootImpl", "getRootType" }));
/*  98:    */     }
/*  99: 95 */     return tmp4_1;
/* 100:    */   }
/* 101:    */   
/* 102:    */   @NotNull
/* 103:    */   public String getUrl()
/* 104:    */   {
/* 105:100 */     String tmp4_1 = this.b;
/* 106:100 */     if (tmp4_1 == null) {
/* 107:100 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/module/impl/JpsModuleSourceRootImpl", "getUrl" }));
/* 108:    */     }
/* 109:100 */     return tmp4_1;
/* 110:    */   }
/* 111:    */   
/* 112:    */   @NotNull
/* 113:    */   public File getFile()
/* 114:    */   {
/* 115:106 */     File tmp7_4 = JpsPathUtil.urlToFile(this.b);
/* 116:106 */     if (tmp7_4 == null) {
/* 117:106 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/module/impl/JpsModuleSourceRootImpl", "getFile" }));
/* 118:    */     }
/* 119:106 */     return tmp7_4;
/* 120:    */   }
/* 121:    */   
/* 122:    */   @NotNull
/* 123:    */   public JpsModuleSourceRootImpl<P> createCopy()
/* 124:    */   {
/* 125:112 */     void tmp8_5 = new JpsModuleSourceRootImpl(this);
/* 126:112 */     if (tmp8_5 == null) {
/* 127:112 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/module/impl/JpsModuleSourceRootImpl", "createCopy" }));
/* 128:    */     }
/* 129:112 */     return tmp8_5;
/* 130:    */   }
/* 131:    */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.jps.model.module.impl.JpsModuleSourceRootImpl

 * JD-Core Version:    0.7.0.1

 */